//
//  SeekEqipmetTableCell.m
//  OperationPro
//
//  Created by yaxue wang on 2017/2/28.
//  Copyright © 2017年 展鸿科技. All rights reserved.
//

#import "SeekEqipmetTableCell.h"
#import "SeekEquipmetModel.h"

@interface SeekEqipmetTableCell()

@property (nonatomic, strong) UILabel *line;

@end
@implementation SeekEqipmetTableCell

- (void)initView{
    [super initView];
    self.backgroundColor =[UIColor whiteColor];
    
    
    self.nameLab = [[UILabel alloc]init];
    [self addSubview:self.nameLab];
    [self.nameLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(15);
        make.centerY.equalTo(self);
     
    }];
    self.nameLab.textColor =C(@"a7a7a7");
    self.nameLab.font =F(14);
    self.nameLab.textAlignment=NSTextAlignmentLeft;
    self.contexLab =[[UILabel alloc]init];
    [self addSubview:self.contexLab];
    [self.contexLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLab.mas_right).offset(10);
        make.centerY.equalTo(self);
        make.right.equalTo(self.mas_right).offset(-15);
        
    }];
    self.contexLab.textColor =C(@"cacaca");
    self.contexLab.font =F(12);
    self.contexLab.numberOfLines=0;
    self.contexLab.textAlignment =NSTextAlignmentRight;
    self.line=[[UILabel alloc]initWithFrame:CGRectMake(15,self.bounds.size.height-0.5 , WindowWidth-15, 0.5)];
    self.line.backgroundColor=LineColor;
    [self addSubview:self.line];
    

    [self setSelectionStyle:UITableViewCellSelectionStyleNone];
}
- (void)setModel:(id)model{
    
//        self.nameLab.text=@"设备名字";
        self.contexLab.text =@"设备类型";

    
    SeekEquipmetModel *order = model;
    if (order.S_name ==nil||[order.S_name isEqualToString:@""]) {
        self.nameLab.text =@"";
        
    }else
    {
        self.nameLab.text=order.S_name;
    }
    if (order.S_type_name ==nil||[order.S_type_name isEqualToString:@""]) {
        self.contexLab.text =@"";
        
    }else
    {
        self.contexLab.text=order.S_type_name;
    }
    
}

@end
